/* 
 *  MHEG-5 Engine (ISO-13522-5)
 *  Copyright (C) 2007 Jason Leonard
 * 
 *  Work based on libmythfreemheg part of mythtv (www.mythtv.org)
 *  Copyright (C) 2004 David C. J. Matthews
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *  Or, point your browser to http://www.gnu.org/copyleft/gpl.html
 *
 */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.IO;

namespace MHEG
{
    public interface IMHEG
    {
        /// <summary>
        /// Sets the booting flag in the MHEG engine.
        /// On the next call to RunAll() the MHEG engine will be reset and attempt to 
        /// boot.
        /// </summary>
        void SetBooting();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="toDraw"></param>        
        void DrawDisplay(Region toDraw);

        /// <summary>
        /// Run synchronous actions and process any asynchronous events 
        /// until the queues are empty.
        /// </summary>
        /// <returns>Returns the number of milliseconds until wake-up or 0 if none.</returns>
        int RunAll();

        /// <summary>
        /// Generate a UserAction event i.e. a key press.
        /// </summary>
        /// <param name="nCode"></param>
        void GenerateUserAction(int nCode);

        /// <summary>
        /// Outputs the current application and state as MHEG test
        /// to the specified writer.
        /// The output is fully reparsable by the engine.
        /// </summary>
        /// <param name="writer">A TextWriter object</param>
        void PrintCurrentApp(TextWriter writer);
    }
}
